package com.naiterui.ehp.bs.doctor.dao.impl;

import com.naiterui.ehp.bp.domain.PatientDisease;
import com.naiterui.ehp.bs.doctor.dao.IPatientDiseaseDao;
import com.naiterui.ehp.bs.doctor.repository.IPatientDiseaseRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 医生对患者备注的病情操作dao
 *
 * @version 2017年6月11日 by wangchuan
 * @Description
 */
@Component
public class AdPatientDiseaseDaoImpl implements IPatientDiseaseDao {

    @Autowired
    private IPatientDiseaseRepository patientDiseaseRepository;

    @Override
    public PatientDisease getRemarkDisease(Long doctorId, Long patientId) {
        List<PatientDisease> diseaseList = patientDiseaseRepository.findByDoctorIdAndPatientId(doctorId, patientId);
        if (diseaseList != null && diseaseList.size() > 0) {
            return diseaseList.get(0);
        }
        return null;
    }

}
